﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Model;
using Core.Parser.ASN1Parser.Nodes;

namespace Core.Parser.ASN1Parser.Builders
{
    internal class BitmapBuilder
    {
        internal static Bitmap Build(TaggedNode node, Group group)
        {
            var bmp = new Bitmap();
            VisibleBuilder.Build(node, bmp, group);

            TaggedNode e;

            if (( e = node[ASN1ContextCodes.C_TILING]) != null)
                bmp.Tiling = e.First.BoolValue;

            if ((e = node[ASN1ContextCodes.C_ORIGINAL_TRANSPARENCY]) != null)
                bmp.OriginalTransparency = e.First.IntValue;

            return bmp;
        }
    }
}
